
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module _mechanize</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>_mechanize</strong></big></big> (version (0, 1, 1, 'a', None))</font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:///C|/prog/python/ogame-bot/lib/mechanize/_mechanize.py">c:\prog\python\ogame-bot\lib\mechanize\_mechanize.py</a></font></td></tr></table>
    <p><tt>Stateful&nbsp;programmatic&nbsp;WWW&nbsp;navigation,&nbsp;after&nbsp;Perl's&nbsp;WWW::Mechanize.<br>
&nbsp;<br>
Copyright&nbsp;2003-2006&nbsp;John&nbsp;J.&nbsp;Lee&nbsp;&lt;jjl@pobox.com&gt;<br>
Copyright&nbsp;2003&nbsp;Andy&nbsp;Lester&nbsp;(original&nbsp;Perl&nbsp;code)<br>
&nbsp;<br>
This&nbsp;code&nbsp;is&nbsp;free&nbsp;software;&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and/or&nbsp;modify&nbsp;it<br>
under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;BSD&nbsp;or&nbsp;ZPL&nbsp;2.1&nbsp;licenses&nbsp;(see&nbsp;the&nbsp;file&nbsp;COPYING.txt<br>
included&nbsp;with&nbsp;the&nbsp;distribution).</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="_Request.html">_Request</a><br>
<a href="copy.html">copy</a><br>
</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
<a href="urllib2.html">urllib2</a><br>
</td><td width="25%" valign=top><a href="urlparse.html">urlparse</a><br>
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="_mechanize.html#History">History</a>
</font></dt><dt><font face="helvetica, arial"><a href="_useragent.html#UserAgent">_useragent.UserAgent</a>(<a href="_Opener.html#OpenerDirector">_Opener.OpenerDirector</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="_mechanize.html#Browser">Browser</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="exceptions.html#Exception">exceptions.Exception</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="_mechanize.html#BrowserStateError">BrowserStateError</a>
</font></dt><dt><font face="helvetica, arial"><a href="_mechanize.html#FormNotFoundError">FormNotFoundError</a>
</font></dt><dt><font face="helvetica, arial"><a href="_mechanize.html#LinkNotFoundError">LinkNotFoundError</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="urllib2.html#BaseHandler">urllib2.BaseHandler</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="_mechanize.html#ResponseUpgradeProcessor">ResponseUpgradeProcessor</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Browser">class <strong>Browser</strong></a>(<a href="_useragent.html#UserAgent">_useragent.UserAgent</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt><a href="#Browser">Browser</a>-like&nbsp;class&nbsp;with&nbsp;support&nbsp;for&nbsp;history,&nbsp;forms&nbsp;and&nbsp;links.<br>
&nbsp;<br>
<a href="#BrowserStateError">BrowserStateError</a>&nbsp;is&nbsp;raised&nbsp;whenever&nbsp;the&nbsp;browser&nbsp;is&nbsp;in&nbsp;the&nbsp;wrong&nbsp;state&nbsp;to<br>
complete&nbsp;the&nbsp;requested&nbsp;operation&nbsp;-&nbsp;eg.,&nbsp;when&nbsp;.<a href="#Browser-back">back</a>()&nbsp;is&nbsp;called&nbsp;when&nbsp;the<br>
browser&nbsp;history&nbsp;is&nbsp;empty,&nbsp;or&nbsp;when&nbsp;.<a href="#Browser-follow_link">follow_link</a>()&nbsp;is&nbsp;called&nbsp;when&nbsp;the&nbsp;current<br>
response&nbsp;does&nbsp;not&nbsp;contain&nbsp;HTML&nbsp;data.<br>
&nbsp;<br>
Public&nbsp;attributes:<br>
&nbsp;<br>
request:&nbsp;current&nbsp;request&nbsp;(mechanize.Request&nbsp;or&nbsp;urllib2.Request)<br>
form:&nbsp;currently&nbsp;selected&nbsp;form&nbsp;(see&nbsp;.<a href="#Browser-select_form">select_form</a>())<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="_mechanize.html#Browser">Browser</a></dd>
<dd><a href="_useragent.html#UserAgent">_useragent.UserAgent</a></dd>
<dd><a href="_Opener.html#OpenerDirector">_Opener.OpenerDirector</a></dd>
<dd><a href="urllib2.html#OpenerDirector">urllib2.OpenerDirector</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="Browser-__getattr__"><strong>__getattr__</strong></a>(self, name)</dt></dl>

<dl><dt><a name="Browser-__init__"><strong>__init__</strong></a>(self, factory<font color="#909090">=None</font>, history<font color="#909090">=None</font>, request_class<font color="#909090">=None</font>)</dt><dd><tt>Only&nbsp;named&nbsp;arguments&nbsp;should&nbsp;be&nbsp;passed&nbsp;to&nbsp;this&nbsp;constructor.<br>
&nbsp;<br>
factory:&nbsp;object&nbsp;implementing&nbsp;the&nbsp;mechanize.Factory&nbsp;interface.<br>
history:&nbsp;object&nbsp;implementing&nbsp;the&nbsp;mechanize.<a href="#History">History</a>&nbsp;interface.&nbsp;&nbsp;Note&nbsp;this<br>
&nbsp;interface&nbsp;is&nbsp;still&nbsp;experimental&nbsp;and&nbsp;may&nbsp;change&nbsp;in&nbsp;future.<br>
request_class:&nbsp;Request&nbsp;class&nbsp;to&nbsp;use.&nbsp;&nbsp;Defaults&nbsp;to&nbsp;mechanize.Request<br>
&nbsp;by&nbsp;default&nbsp;for&nbsp;Pythons&nbsp;older&nbsp;than&nbsp;2.4,&nbsp;urllib2.Request&nbsp;otherwise.<br>
&nbsp;<br>
The&nbsp;Factory&nbsp;and&nbsp;<a href="#History">History</a>&nbsp;objects&nbsp;passed&nbsp;in&nbsp;are&nbsp;'owned'&nbsp;by&nbsp;the&nbsp;<a href="#Browser">Browser</a>,<br>
so&nbsp;they&nbsp;should&nbsp;not&nbsp;be&nbsp;shared&nbsp;across&nbsp;Browsers.&nbsp;&nbsp;In&nbsp;particular,<br>
factory.<a href="#Browser-set_response">set_response</a>()&nbsp;should&nbsp;not&nbsp;be&nbsp;called&nbsp;except&nbsp;by&nbsp;the&nbsp;owning<br>
<a href="#Browser">Browser</a>&nbsp;itself.<br>
&nbsp;<br>
Note&nbsp;that&nbsp;the&nbsp;supplied&nbsp;factory's&nbsp;request_class&nbsp;is&nbsp;overridden&nbsp;by&nbsp;this<br>
constructor,&nbsp;to&nbsp;ensure&nbsp;only&nbsp;one&nbsp;Request&nbsp;class&nbsp;is&nbsp;used.</tt></dd></dl>

<dl><dt><a name="Browser-back"><strong>back</strong></a>(self, n<font color="#909090">=1</font>)</dt><dd><tt>Go&nbsp;back&nbsp;n&nbsp;steps&nbsp;in&nbsp;history,&nbsp;and&nbsp;return&nbsp;response&nbsp;object.<br>
&nbsp;<br>
n:&nbsp;go&nbsp;back&nbsp;this&nbsp;number&nbsp;of&nbsp;steps&nbsp;(default&nbsp;1&nbsp;step)</tt></dd></dl>

<dl><dt><a name="Browser-clear_history"><strong>clear_history</strong></a>(self)</dt></dl>

<dl><dt><a name="Browser-click"><strong>click</strong></a>(self, *args, **kwds)</dt><dd><tt>See&nbsp;ClientForm.HTMLForm.click&nbsp;for&nbsp;documentation.</tt></dd></dl>

<dl><dt><a name="Browser-click_link"><strong>click_link</strong></a>(self, link<font color="#909090">=None</font>, **kwds)</dt><dd><tt>Find&nbsp;a&nbsp;link&nbsp;and&nbsp;return&nbsp;a&nbsp;Request&nbsp;object&nbsp;for&nbsp;it.<br>
&nbsp;<br>
Arguments&nbsp;are&nbsp;as&nbsp;for&nbsp;.<a href="#Browser-find_link">find_link</a>(),&nbsp;except&nbsp;that&nbsp;a&nbsp;link&nbsp;may&nbsp;be&nbsp;supplied<br>
as&nbsp;the&nbsp;first&nbsp;argument.</tt></dd></dl>

<dl><dt><a name="Browser-close"><strong>close</strong></a>(self)</dt></dl>

<dl><dt><a name="Browser-encoding"><strong>encoding</strong></a>(self)</dt></dl>

<dl><dt><a name="Browser-find_link"><strong>find_link</strong></a>(self, **kwds)</dt><dd><tt>Find&nbsp;a&nbsp;link&nbsp;in&nbsp;current&nbsp;page.<br>
&nbsp;<br>
Links&nbsp;are&nbsp;returned&nbsp;as&nbsp;mechanize.Link&nbsp;objects.<br>
&nbsp;<br>
#&nbsp;Return&nbsp;third&nbsp;link&nbsp;that&nbsp;.search()-matches&nbsp;the&nbsp;regexp&nbsp;"python"<br>
#&nbsp;(by&nbsp;".search()-matches",&nbsp;I&nbsp;mean&nbsp;that&nbsp;the&nbsp;regular&nbsp;expression&nbsp;method<br>
#&nbsp;.search()&nbsp;is&nbsp;used,&nbsp;rather&nbsp;than&nbsp;.match()).<br>
<a href="#Browser-find_link">find_link</a>(text_regex=re.compile("python"),&nbsp;nr=2)<br>
&nbsp;<br>
#&nbsp;Return&nbsp;first&nbsp;http&nbsp;link&nbsp;in&nbsp;the&nbsp;current&nbsp;page&nbsp;that&nbsp;points&nbsp;to&nbsp;somewhere<br>
#&nbsp;on&nbsp;python.org&nbsp;whose&nbsp;link&nbsp;text&nbsp;(after&nbsp;tags&nbsp;have&nbsp;been&nbsp;removed)&nbsp;is<br>
#&nbsp;exactly&nbsp;"monty&nbsp;python".<br>
<a href="#Browser-find_link">find_link</a>(text="monty&nbsp;python",<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;url_regex=re.compile("http.*python.org"))<br>
&nbsp;<br>
#&nbsp;Return&nbsp;first&nbsp;link&nbsp;with&nbsp;exactly&nbsp;three&nbsp;HTML&nbsp;attributes.<br>
<a href="#Browser-find_link">find_link</a>(predicate=lambda&nbsp;link:&nbsp;len(link.attrs)&nbsp;==&nbsp;3)<br>
&nbsp;<br>
Links&nbsp;include&nbsp;anchors&nbsp;(&lt;a&gt;),&nbsp;image&nbsp;maps&nbsp;(&lt;area&gt;),&nbsp;and&nbsp;frames&nbsp;(&lt;frame&gt;,<br>
&lt;iframe&gt;).<br>
&nbsp;<br>
All&nbsp;arguments&nbsp;must&nbsp;be&nbsp;passed&nbsp;by&nbsp;keyword,&nbsp;not&nbsp;position.&nbsp;&nbsp;Zero&nbsp;or&nbsp;more<br>
arguments&nbsp;may&nbsp;be&nbsp;supplied.&nbsp;&nbsp;In&nbsp;order&nbsp;to&nbsp;find&nbsp;a&nbsp;link,&nbsp;all&nbsp;arguments<br>
supplied&nbsp;must&nbsp;match.<br>
&nbsp;<br>
If&nbsp;a&nbsp;matching&nbsp;link&nbsp;is&nbsp;not&nbsp;found,&nbsp;mechanize.<a href="#LinkNotFoundError">LinkNotFoundError</a>&nbsp;is&nbsp;raised.<br>
&nbsp;<br>
text:&nbsp;link&nbsp;text&nbsp;between&nbsp;link&nbsp;tags:&nbsp;eg.&nbsp;&lt;a&nbsp;href="blah"&gt;this&nbsp;bit&lt;/a&gt;&nbsp;(as<br>
&nbsp;returned&nbsp;by&nbsp;pullparser.get_compressed_text(),&nbsp;ie.&nbsp;without&nbsp;tags&nbsp;but<br>
&nbsp;with&nbsp;opening&nbsp;tags&nbsp;"textified"&nbsp;as&nbsp;per&nbsp;the&nbsp;pullparser&nbsp;docs)&nbsp;must&nbsp;compare<br>
&nbsp;equal&nbsp;to&nbsp;this&nbsp;argument,&nbsp;if&nbsp;supplied<br>
text_regex:&nbsp;link&nbsp;text&nbsp;between&nbsp;tag&nbsp;(as&nbsp;defined&nbsp;above)&nbsp;must&nbsp;match&nbsp;the<br>
&nbsp;regular&nbsp;expression&nbsp;object&nbsp;passed&nbsp;as&nbsp;this&nbsp;argument,&nbsp;if&nbsp;supplied<br>
name,&nbsp;name_regex:&nbsp;as&nbsp;for&nbsp;text&nbsp;and&nbsp;text_regex,&nbsp;but&nbsp;matched&nbsp;against&nbsp;the<br>
&nbsp;name&nbsp;HTML&nbsp;attribute&nbsp;of&nbsp;the&nbsp;link&nbsp;tag<br>
url,&nbsp;url_regex:&nbsp;as&nbsp;for&nbsp;text&nbsp;and&nbsp;text_regex,&nbsp;but&nbsp;matched&nbsp;against&nbsp;the<br>
&nbsp;URL&nbsp;of&nbsp;the&nbsp;link&nbsp;tag&nbsp;(note&nbsp;this&nbsp;matches&nbsp;against&nbsp;Link.url,&nbsp;which&nbsp;is&nbsp;a<br>
&nbsp;relative&nbsp;or&nbsp;absolute&nbsp;URL&nbsp;according&nbsp;to&nbsp;how&nbsp;it&nbsp;was&nbsp;written&nbsp;in&nbsp;the&nbsp;HTML)<br>
tag:&nbsp;element&nbsp;name&nbsp;of&nbsp;opening&nbsp;tag,&nbsp;eg.&nbsp;"a"<br>
predicate:&nbsp;a&nbsp;function&nbsp;taking&nbsp;a&nbsp;Link&nbsp;object&nbsp;as&nbsp;its&nbsp;single&nbsp;argument,<br>
&nbsp;returning&nbsp;a&nbsp;boolean&nbsp;result,&nbsp;indicating&nbsp;whether&nbsp;the&nbsp;links<br>
nr:&nbsp;matches&nbsp;the&nbsp;nth&nbsp;link&nbsp;that&nbsp;matches&nbsp;all&nbsp;other&nbsp;criteria&nbsp;(default&nbsp;0)</tt></dd></dl>

<dl><dt><a name="Browser-follow_link"><strong>follow_link</strong></a>(self, link<font color="#909090">=None</font>, **kwds)</dt><dd><tt>Find&nbsp;a&nbsp;link&nbsp;and&nbsp;.<a href="#Browser-open">open</a>()&nbsp;it.<br>
&nbsp;<br>
Arguments&nbsp;are&nbsp;as&nbsp;for&nbsp;.<a href="#Browser-click_link">click_link</a>().<br>
&nbsp;<br>
Return&nbsp;value&nbsp;is&nbsp;same&nbsp;as&nbsp;for&nbsp;<a href="#Browser">Browser</a>.<a href="#Browser-open">open</a>().</tt></dd></dl>

<dl><dt><a name="Browser-forms"><strong>forms</strong></a>(self)</dt><dd><tt>Return&nbsp;iterable&nbsp;over&nbsp;forms.<br>
&nbsp;<br>
The&nbsp;returned&nbsp;form&nbsp;objects&nbsp;implement&nbsp;the&nbsp;ClientForm.HTMLForm&nbsp;interface.</tt></dd></dl>

<dl><dt><a name="Browser-geturl"><strong>geturl</strong></a>(self)</dt><dd><tt>Get&nbsp;URL&nbsp;of&nbsp;current&nbsp;document.</tt></dd></dl>

<dl><dt><a name="Browser-links"><strong>links</strong></a>(self, **kwds)</dt><dd><tt>Return&nbsp;iterable&nbsp;over&nbsp;links&nbsp;(mechanize.Link&nbsp;objects).</tt></dd></dl>

<dl><dt><a name="Browser-open"><strong>open</strong></a>(self, url, data<font color="#909090">=None</font>)</dt></dl>

<dl><dt><a name="Browser-reload"><strong>reload</strong></a>(self)</dt><dd><tt>Reload&nbsp;current&nbsp;document,&nbsp;and&nbsp;return&nbsp;response&nbsp;object.</tt></dd></dl>

<dl><dt><a name="Browser-response"><strong>response</strong></a>(self)</dt><dd><tt>Return&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;current&nbsp;response.<br>
&nbsp;<br>
The&nbsp;returned&nbsp;object&nbsp;has&nbsp;the&nbsp;same&nbsp;interface&nbsp;as&nbsp;the&nbsp;object&nbsp;returned&nbsp;by<br>
.<a href="#Browser-open">open</a>()&nbsp;(or&nbsp;urllib2.urlopen()).</tt></dd></dl>

<dl><dt><a name="Browser-select_form"><strong>select_form</strong></a>(self, name<font color="#909090">=None</font>, predicate<font color="#909090">=None</font>, nr<font color="#909090">=None</font>)</dt><dd><tt>Select&nbsp;an&nbsp;HTML&nbsp;form&nbsp;for&nbsp;input.<br>
&nbsp;<br>
This&nbsp;is&nbsp;a&nbsp;bit&nbsp;like&nbsp;giving&nbsp;a&nbsp;form&nbsp;the&nbsp;"input&nbsp;focus"&nbsp;in&nbsp;a&nbsp;browser.<br>
&nbsp;<br>
If&nbsp;a&nbsp;form&nbsp;is&nbsp;selected,&nbsp;the&nbsp;<a href="#Browser">Browser</a>&nbsp;object&nbsp;supports&nbsp;the&nbsp;HTMLForm<br>
interface,&nbsp;so&nbsp;you&nbsp;can&nbsp;call&nbsp;methods&nbsp;like&nbsp;.set_value(),&nbsp;.set(),&nbsp;and<br>
.<a href="#Browser-click">click</a>().<br>
&nbsp;<br>
At&nbsp;least&nbsp;one&nbsp;of&nbsp;the&nbsp;name,&nbsp;predicate&nbsp;and&nbsp;nr&nbsp;arguments&nbsp;must&nbsp;be&nbsp;supplied.<br>
If&nbsp;no&nbsp;matching&nbsp;form&nbsp;is&nbsp;found,&nbsp;mechanize.<a href="#FormNotFoundError">FormNotFoundError</a>&nbsp;is&nbsp;raised.<br>
&nbsp;<br>
If&nbsp;name&nbsp;is&nbsp;specified,&nbsp;then&nbsp;the&nbsp;form&nbsp;must&nbsp;have&nbsp;the&nbsp;indicated&nbsp;name.<br>
&nbsp;<br>
If&nbsp;predicate&nbsp;is&nbsp;specified,&nbsp;then&nbsp;the&nbsp;form&nbsp;must&nbsp;match&nbsp;that&nbsp;function.&nbsp;&nbsp;The<br>
predicate&nbsp;function&nbsp;is&nbsp;passed&nbsp;the&nbsp;HTMLForm&nbsp;as&nbsp;its&nbsp;single&nbsp;argument,&nbsp;and<br>
should&nbsp;return&nbsp;a&nbsp;boolean&nbsp;value&nbsp;indicating&nbsp;whether&nbsp;the&nbsp;form&nbsp;matched.<br>
&nbsp;<br>
nr,&nbsp;if&nbsp;supplied,&nbsp;is&nbsp;the&nbsp;sequence&nbsp;number&nbsp;of&nbsp;the&nbsp;form&nbsp;(where&nbsp;0&nbsp;is&nbsp;the<br>
first).&nbsp;&nbsp;Note&nbsp;that&nbsp;control&nbsp;0&nbsp;is&nbsp;the&nbsp;first&nbsp;form&nbsp;matching&nbsp;all&nbsp;the&nbsp;other<br>
arguments&nbsp;(if&nbsp;supplied);&nbsp;it&nbsp;is&nbsp;not&nbsp;necessarily&nbsp;the&nbsp;first&nbsp;control&nbsp;in&nbsp;the<br>
form.</tt></dd></dl>

<dl><dt><a name="Browser-set_response"><strong>set_response</strong></a>(self, response)</dt><dd><tt>Replace&nbsp;current&nbsp;response&nbsp;with&nbsp;(a&nbsp;copy&nbsp;of)&nbsp;response.</tt></dd></dl>

<dl><dt><a name="Browser-submit"><strong>submit</strong></a>(self, *args, **kwds)</dt><dd><tt>Submit&nbsp;current&nbsp;form.<br>
&nbsp;<br>
Arguments&nbsp;are&nbsp;as&nbsp;for&nbsp;ClientForm.HTMLForm.<a href="#Browser-click">click</a>().<br>
&nbsp;<br>
Return&nbsp;value&nbsp;is&nbsp;same&nbsp;as&nbsp;for&nbsp;<a href="#Browser">Browser</a>.<a href="#Browser-open">open</a>().</tt></dd></dl>

<dl><dt><a name="Browser-title"><strong>title</strong></a>(self)</dt><dd><tt>Return&nbsp;title,&nbsp;or&nbsp;None&nbsp;if&nbsp;there&nbsp;is&nbsp;no&nbsp;title&nbsp;element&nbsp;in&nbsp;the&nbsp;document.<br>
&nbsp;<br>
Tags&nbsp;are&nbsp;stripped&nbsp;or&nbsp;textified&nbsp;as&nbsp;described&nbsp;in&nbsp;docs&nbsp;for<br>
PullParser.get_text()&nbsp;method&nbsp;of&nbsp;pullparser&nbsp;module.</tt></dd></dl>

<dl><dt><a name="Browser-viewing_html"><strong>viewing_html</strong></a>(self)</dt><dd><tt>Return&nbsp;whether&nbsp;the&nbsp;current&nbsp;response&nbsp;contains&nbsp;HTML&nbsp;data.</tt></dd></dl>

<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>default_others</strong> = ['_unknown', '_http_error', '_http_request_upgrade', '_http_default_error', '_response_upgrade']</dl>

<dl><dt><strong>handler_classes</strong> = {'_basicauth': &lt;class urllib2.HTTPBasicAuthHandler&gt;, '_cookies': &lt;class _urllib2_support.HTTPCookieProcessor&gt;, '_debug_redirect': &lt;class _urllib2_support.HTTPRedirectDebugProcessor&gt;, '_debug_response_body': &lt;class _urllib2_support.HTTPResponseDebugProcessor&gt;, '_digestauth': &lt;class urllib2.HTTPBasicAuthHandler&gt;, '_equiv': &lt;class _urllib2_support.HTTPEquivProcessor&gt;, '_http_default_error': &lt;class urllib2.HTTPDefaultErrorHandler&gt;, '_http_error': &lt;class urllib2.HTTPErrorProcessor&gt;, '_http_request_upgrade': &lt;class _urllib2_support.HTTPRequestUpgradeProcessor&gt;, '_proxy': &lt;class urllib2.ProxyHandler&gt;, ...}</dl>

<hr>
Methods inherited from <a href="_useragent.html#UserAgent">_useragent.UserAgent</a>:<br>
<dl><dt><a name="Browser-add_password"><strong>add_password</strong></a>(self, url, user, password, realm<font color="#909090">=None</font>)</dt></dl>

<dl><dt><a name="Browser-add_proxy_password"><strong>add_proxy_password</strong></a>(self, user, password, hostport<font color="#909090">=None</font>, realm<font color="#909090">=None</font>)</dt></dl>

<dl><dt><a name="Browser-set_cookiejar"><strong>set_cookiejar</strong></a>(self, cookiejar)</dt><dd><tt>Set&nbsp;a&nbsp;mechanize.CookieJar,&nbsp;or&nbsp;None.</tt></dd></dl>

<dl><dt><a name="Browser-set_debug_http"><strong>set_debug_http</strong></a>(self, handle)</dt><dd><tt>Print&nbsp;HTTP&nbsp;headers&nbsp;to&nbsp;sys.stdout.</tt></dd></dl>

<dl><dt><a name="Browser-set_debug_redirects"><strong>set_debug_redirects</strong></a>(self, handle)</dt><dd><tt>Log&nbsp;information&nbsp;about&nbsp;HTTP&nbsp;redirects&nbsp;(including&nbsp;refreshes).<br>
&nbsp;<br>
Logging&nbsp;is&nbsp;performed&nbsp;using&nbsp;module&nbsp;logging.&nbsp;&nbsp;The&nbsp;logger&nbsp;name&nbsp;is<br>
"mechanize.http_redirects".&nbsp;&nbsp;To&nbsp;actually&nbsp;print&nbsp;some&nbsp;debug&nbsp;output,<br>
eg:<br>
&nbsp;<br>
import&nbsp;sys,&nbsp;logging<br>
logger&nbsp;=&nbsp;logging.getLogger("mechanize.http_redirects")<br>
logger.addHandler(logging.StreamHandler(sys.stdout))<br>
logger.setLevel(logging.INFO)<br>
&nbsp;<br>
Other&nbsp;logger&nbsp;names&nbsp;relevant&nbsp;to&nbsp;this&nbsp;module:<br>
&nbsp;<br>
"mechanize.http_responses"<br>
"mechanize.cookies"&nbsp;(or&nbsp;"cookielib"&nbsp;if&nbsp;running&nbsp;Python&nbsp;2.4)<br>
&nbsp;<br>
To&nbsp;turn&nbsp;on&nbsp;everything:<br>
&nbsp;<br>
import&nbsp;sys,&nbsp;logging<br>
logger&nbsp;=&nbsp;logging.getLogger("mechanize")<br>
logger.addHandler(logging.StreamHandler(sys.stdout))<br>
logger.setLevel(logging.INFO)</tt></dd></dl>

<dl><dt><a name="Browser-set_debug_responses"><strong>set_debug_responses</strong></a>(self, handle)</dt><dd><tt>Log&nbsp;HTTP&nbsp;response&nbsp;bodies.<br>
&nbsp;<br>
See&nbsp;docstring&nbsp;for&nbsp;.<a href="#Browser-set_debug_redirects">set_debug_redirects</a>()&nbsp;for&nbsp;details&nbsp;of&nbsp;logging.</tt></dd></dl>

<dl><dt><a name="Browser-set_handle_equiv"><strong>set_handle_equiv</strong></a>(self, handle, head_parser_class<font color="#909090">=None</font>)</dt><dd><tt>Set&nbsp;whether&nbsp;to&nbsp;treat&nbsp;HTML&nbsp;http-equiv&nbsp;headers&nbsp;like&nbsp;HTTP&nbsp;headers.<br>
&nbsp;<br>
Response&nbsp;objects&nbsp;will&nbsp;be&nbsp;.seek()able&nbsp;if&nbsp;this&nbsp;is&nbsp;set.</tt></dd></dl>

<dl><dt><a name="Browser-set_handle_redirect"><strong>set_handle_redirect</strong></a>(self, handle)</dt><dd><tt>Set&nbsp;whether&nbsp;to&nbsp;handle&nbsp;HTTP&nbsp;30x&nbsp;redirections.</tt></dd></dl>

<dl><dt><a name="Browser-set_handle_referer"><strong>set_handle_referer</strong></a>(self, handle)</dt><dd><tt>Set&nbsp;whether&nbsp;to&nbsp;add&nbsp;Referer&nbsp;header&nbsp;to&nbsp;each&nbsp;request.<br>
&nbsp;<br>
This&nbsp;base&nbsp;class&nbsp;does&nbsp;not&nbsp;implement&nbsp;this&nbsp;feature&nbsp;(so&nbsp;don't&nbsp;turn&nbsp;this&nbsp;on<br>
if&nbsp;you're&nbsp;using&nbsp;this&nbsp;base&nbsp;class&nbsp;directly),&nbsp;but&nbsp;the&nbsp;subclass<br>
mechanize.<a href="#Browser">Browser</a>&nbsp;does.</tt></dd></dl>

<dl><dt><a name="Browser-set_handle_refresh"><strong>set_handle_refresh</strong></a>(self, handle, max_time<font color="#909090">=None</font>, honor_time<font color="#909090">=True</font>)</dt><dd><tt>Set&nbsp;whether&nbsp;to&nbsp;handle&nbsp;HTTP&nbsp;Refresh&nbsp;headers.</tt></dd></dl>

<dl><dt><a name="Browser-set_handle_robots"><strong>set_handle_robots</strong></a>(self, handle)</dt><dd><tt>Set&nbsp;whether&nbsp;to&nbsp;observe&nbsp;rules&nbsp;from&nbsp;robots.txt.</tt></dd></dl>

<dl><dt><a name="Browser-set_handled_schemes"><strong>set_handled_schemes</strong></a>(self, schemes)</dt><dd><tt>Set&nbsp;sequence&nbsp;of&nbsp;URL&nbsp;scheme&nbsp;(protocol)&nbsp;strings.<br>
&nbsp;<br>
For&nbsp;example:&nbsp;ua.<a href="#Browser-set_handled_schemes">set_handled_schemes</a>(["http",&nbsp;"ftp"])<br>
&nbsp;<br>
If&nbsp;this&nbsp;fails&nbsp;(with&nbsp;ValueError)&nbsp;because&nbsp;you've&nbsp;passed&nbsp;an&nbsp;unknown<br>
scheme,&nbsp;the&nbsp;set&nbsp;of&nbsp;handled&nbsp;schemes&nbsp;will&nbsp;not&nbsp;be&nbsp;changed.</tt></dd></dl>

<dl><dt><a name="Browser-set_password_manager"><strong>set_password_manager</strong></a>(self, password_manager)</dt><dd><tt>Set&nbsp;a&nbsp;urllib2.HTTPPasswordMgrWithDefaultRealm,&nbsp;or&nbsp;None.</tt></dd></dl>

<dl><dt><a name="Browser-set_proxies"><strong>set_proxies</strong></a>(self, proxies)</dt><dd><tt>Set&nbsp;a&nbsp;dictionary&nbsp;mapping&nbsp;URL&nbsp;scheme&nbsp;to&nbsp;proxy&nbsp;specification,&nbsp;or&nbsp;None.<br>
&nbsp;<br>
e.g.&nbsp;{'http':&nbsp;'myproxy.example.com',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'ftp':&nbsp;'joe:password@proxy.example.com:8080'}</tt></dd></dl>

<dl><dt><a name="Browser-set_proxy_password_manager"><strong>set_proxy_password_manager</strong></a>(self, password_manager)</dt><dd><tt>Set&nbsp;a&nbsp;mechanize.HTTPProxyPasswordMgr,&nbsp;or&nbsp;None.</tt></dd></dl>

<dl><dt><a name="Browser-set_seekable_responses"><strong>set_seekable_responses</strong></a>(self, handle)</dt><dd><tt>Make&nbsp;response&nbsp;objects&nbsp;.seek()able.</tt></dd></dl>

<hr>
Data and other attributes inherited from <a href="_useragent.html#UserAgent">_useragent.UserAgent</a>:<br>
<dl><dt><strong>default_features</strong> = ['_redirect', '_cookies', '_referer', '_refresh', '_equiv', '_basicauth', '_digestauth', '_proxy', '_proxy_basicauth', '_proxy_digestauth', '_seek', '_robots']</dl>

<dl><dt><strong>default_schemes</strong> = ['http', 'ftp', 'file', 'gopher']</dl>

<hr>
Methods inherited from <a href="_Opener.html#OpenerDirector">_Opener.OpenerDirector</a>:<br>
<dl><dt><a name="Browser-add_handler"><strong>add_handler</strong></a>(self, handler)</dt></dl>

<dl><dt><a name="Browser-error"><strong>error</strong></a>(self, proto, *args)</dt></dl>

<dl><dt><a name="Browser-retrieve"><strong>retrieve</strong></a>(self, fullurl, filename<font color="#909090">=None</font>, reporthook<font color="#909090">=None</font>, data<font color="#909090">=None</font>)</dt><dd><tt>Returns&nbsp;(filename,&nbsp;headers).<br>
&nbsp;<br>
For&nbsp;remote&nbsp;objects,&nbsp;the&nbsp;default&nbsp;filename&nbsp;will&nbsp;refer&nbsp;to&nbsp;a&nbsp;temporary<br>
file.</tt></dd></dl>

</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="BrowserStateError">class <strong>BrowserStateError</strong></a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><a name="BrowserStateError-__getitem__"><strong>__getitem__</strong></a>(...)</dt></dl>

<dl><dt><a name="BrowserStateError-__init__"><strong>__init__</strong></a>(...)</dt></dl>

<dl><dt><a name="BrowserStateError-__str__"><strong>__str__</strong></a>(...)</dt></dl>

</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="FormNotFoundError">class <strong>FormNotFoundError</strong></a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><a name="FormNotFoundError-__getitem__"><strong>__getitem__</strong></a>(...)</dt></dl>

<dl><dt><a name="FormNotFoundError-__init__"><strong>__init__</strong></a>(...)</dt></dl>

<dl><dt><a name="FormNotFoundError-__str__"><strong>__str__</strong></a>(...)</dt></dl>

</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="History">class <strong>History</strong></a></font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Though&nbsp;this&nbsp;will&nbsp;become&nbsp;public,&nbsp;the&nbsp;implied&nbsp;interface&nbsp;is&nbsp;not&nbsp;yet&nbsp;stable.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="History-__init__"><strong>__init__</strong></a>(self)</dt></dl>

<dl><dt><a name="History-add"><strong>add</strong></a>(self, request, response)</dt></dl>

<dl><dt><a name="History-back"><strong>back</strong></a>(self, n, _response)</dt></dl>

<dl><dt><a name="History-clear"><strong>clear</strong></a>(self)</dt></dl>

<dl><dt><a name="History-close"><strong>close</strong></a>(self)</dt></dl>

</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="LinkNotFoundError">class <strong>LinkNotFoundError</strong></a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><a name="LinkNotFoundError-__getitem__"><strong>__getitem__</strong></a>(...)</dt></dl>

<dl><dt><a name="LinkNotFoundError-__init__"><strong>__init__</strong></a>(...)</dt></dl>

<dl><dt><a name="LinkNotFoundError-__str__"><strong>__str__</strong></a>(...)</dt></dl>

</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="ResponseUpgradeProcessor">class <strong>ResponseUpgradeProcessor</strong></a>(<a href="urllib2.html#BaseHandler">urllib2.BaseHandler</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="ResponseUpgradeProcessor-any_response"><strong>any_response</strong></a>(self, request, response)</dt></dl>

<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>handler_order</strong> = 0</dl>

<hr>
Methods inherited from <a href="urllib2.html#BaseHandler">urllib2.BaseHandler</a>:<br>
<dl><dt><a name="ResponseUpgradeProcessor-__lt__"><strong>__lt__</strong></a>(self, other)</dt></dl>

<dl><dt><a name="ResponseUpgradeProcessor-add_parent"><strong>add_parent</strong></a>(self, parent)</dt></dl>

<dl><dt><a name="ResponseUpgradeProcessor-close"><strong>close</strong></a>(self)</dt></dl>

</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
    
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-upgrade_response"><strong>upgrade_response</strong></a>(response)</dt><dd><tt>#&nbsp;Horrible,&nbsp;but&nbsp;needed,&nbsp;at&nbsp;least&nbsp;until&nbsp;fork&nbsp;urllib2.&nbsp;&nbsp;Even&nbsp;then,&nbsp;may&nbsp;want<br>
#&nbsp;to&nbsp;preseve&nbsp;urllib2&nbsp;compatibility.</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>__version__</strong> = (0, 1, 1, 'a', None)<br>
<strong>generators</strong> = _Feature((2, 2, 0, 'alpha', 1), (2, 3, 0, 'final', 0), 4096)</td></tr></table>
</body></html>